﻿CREATE PROCEDURE [acms].[Post_GetByIdOnly]
	@Id int
AS
	declare @tmp DateTime
	select @tmp = PublishFrom From Post_View where Id = @Id
	
	select a.*, b.ParentPath, b.PublishDate as SiteVersion
	from Post_View a 
		inner join PostPositions b on a.Id = b.PostId and isnull(b.PublishDate, '9999/12/31') = isnull(@tmp, '9999/12/31')
	where a.Id = @Id
RETURN 0;